<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>体温上报</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name=”apple-mobile-web-app-status-bar-style” content=”default”/>
    <meta name=”apple-mobile-web-app-status-bar-style” content=”black”/>
    <meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent”/>
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <meta name="format-detection" content="telephone=no"/>
    <script type="text/javascript" src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>
    <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css"/>
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/indexyq.css?123456789"/>
</head>
<body>
<div class="content">
    <div class="topbanner"><img src="${s.base}/mobile/images/topimg.jpg"></div>
    <div class="blcokcont marb20">
        <div class="blcoktit">基本信息</div>
        <div class="blockinput">
            <label>姓名</label>
            <input type="text" value="${name}" readonly="readonly"/>
        </div>
        <div class="blockinput">
            <label>地址</label>
            <input type="text" value="${buildingId}" readonly="readonly"/>
        </div>
    </div>
    <div class="blcokcont marb20">
        <div class="blcoktit">健康信息</div>
        <div class="blockinput">
            <label>体温状态</label>
            <input type="text" id="temperatureStatus" value="" placeholder="请选择"/>
            <div class="block-line-hr"><img src="${s.base}/mobile/images/hr.png"></div>
        </div>
        <div class="blockinput">
            <label>体温数值</label>
            <input type="text" id="temperature" placeholder="请输入体温数值"/>
            <div class="block-line-hr">℃</div>
        </div>
    </div>
    <div class="sumitbtn">提交</div>
</div>
</body>
<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/jquery-weui.js"></script>
<script type="text/javascript" src="${s.base}/mobile/js/constant.js"></script>
<script>
    $(function () {
        $.fn.initSelect("#temperatureStatus", "体温状态", temperatureStatus);

        //点击提交按钮
        $(".sumitbtn").bind("click", function () {

            if (isBlank($('#temperatureStatus').val())) {
                $.toast("请选择体温状态", "text");
                return false;
            }

            if (isBlank($('#temperature').val())) {
                $.toast("请输入体温数值", "text");
                return false;
            } else {
                var reg = /^[1-9][0-9]+(.[0-9])?$/;
                if (!reg.test($('#temperature').val())) {
                    $.toast("体温数值格式不正确", "text");
                    return false;
                }
            }

            var data = {
                temperatureStatus: $('#temperatureStatus').attr("data-values"),
                temperature: $('#temperature').val(),
                applyId: '${applyId}',
                personId: '${personId}'
            };
            $.fn.doPost('/phone/antiepidemic/temperature/addOrUpdate', data, function (result) {
                if (result.code === 0) {
                    window.location.href = "/phone/antiepidemic/index?token=${token}&applyId=${applyId}&communityId=${communityId}";
                } else {
                    $.toast(result.msg, "text");
                }
            });
        });
    })
</script>
</html>